/*   1:    */ package org.jetbrains.jps.model.serialization.module;
/*   2:    */ 
/*   3:    */

import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.JDOMUtil;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.util.text.UniqueNameGenerator;
import org.jdom.Element;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jps.model.JpsElement;
import org.jetbrains.jps.model.JpsElementFactory;
import org.jetbrains.jps.model.JpsElementReference;
import org.jetbrains.jps.model.java.JpsJavaSdkType;
import org.jetbrains.jps.model.java.JpsJavaSdkTypeWrapper;
import org.jetbrains.jps.model.library.JpsLibrary;
import org.jetbrains.jps.model.library.JpsLibraryReference;
import org.jetbrains.jps.model.library.sdk.JpsSdkReference;
import org.jetbrains.jps.model.library.sdk.JpsSdkType;
import org.jetbrains.jps.model.module.*;
import org.jetbrains.jps.model.serialization.JpsModelSerializerExtension;
import org.jetbrains.jps.model.serialization.java.JpsJavaModelSerializerExtension;
import org.jetbrains.jps.model.serialization.library.JpsLibraryTableSerializer;
import org.jetbrains.jps.model.serialization.library.JpsSdkTableSerializer;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;

/*   4:    */
/*   5:    */
/*   6:    */
/*   7:    */
/*   8:    */
/*   9:    */
/*  10:    */
/*  11:    */
/*  12:    */
/*  13:    */
/*  14:    */
/*  15:    */
/*  16:    */
/*  17:    */
/*  18:    */
/*  19:    */
/*  20:    */
/*  21:    */
/*  22:    */
/*  23:    */
/*  24:    */
/*  25:    */
/*  26:    */
/*  27:    */
/*  28:    */
/*  29:    */
/*  30:    */
/*  31:    */
/*  32:    */
/*  33:    */
/*  34:    */
/*  35:    */
/*  36:    */
/*  37:    */
/*  38:    */
/*  39:    */
/*  40:    */
/*  41:    */
/*  42:    */ 
/*  43:    */ public class JpsModuleRootModelSerializer
/*  44:    */ {
/*  45: 50 */   private static final Logger a = Logger.getInstance(JpsModuleRootModelSerializer.class);
/*  46:    */   public static final String URL_ATTRIBUTE = "url";
/*  47:    */   public static final String CONTENT_TAG = "content";
/*  48:    */   public static final String SOURCE_FOLDER_TAG = "sourceFolder";
/*  49:    */   public static final String PACKAGE_PREFIX_ATTRIBUTE = "packagePrefix";
/*  50:    */   public static final String IS_TEST_SOURCE_ATTRIBUTE = "isTestSource";
/*  51:    */   public static final String EXCLUDE_FOLDER_TAG = "excludeFolder";
/*  52:    */   public static final String ORDER_ENTRY_TAG = "orderEntry";
/*  53:    */   public static final String TYPE_ATTRIBUTE = "type";
/*  54:    */   public static final String SOURCE_FOLDER_TYPE = "sourceFolder";
/*  55:    */   public static final String JDK_TYPE = "jdk";
/*  56:    */   public static final String JDK_NAME_ATTRIBUTE = "jdkName";
/*  57:    */   public static final String JDK_TYPE_ATTRIBUTE = "jdkType";
/*  58:    */   public static final String INHERITED_JDK_TYPE = "inheritedJdk";
/*  59:    */   public static final String LIBRARY_TYPE = "library";
/*  60:    */   public static final String NAME_ATTRIBUTE = "name";
/*  61:    */   public static final String LEVEL_ATTRIBUTE = "level";
/*  62:    */   public static final String LIBRARY_TAG = "library";
/*  63:    */   public static final String MODULE_LIBRARY_TYPE = "module-library";
/*  64:    */   public static final String MODULE_TYPE = "module";
/*  65:    */   public static final String MODULE_NAME_ATTRIBUTE = "module-name";
/*  66:    */   private static final String b = "type";
/*  67:    */   public static final String JAVA_SOURCE_ROOT_TYPE_ID = "java-source";
/*  68:    */   public static final String JAVA_TEST_ROOT_TYPE_ID = "java-test";
/*  69:    */   private static final String c = "#";
/*  70:    */   
/*  71:    */   public static void loadRootModel(JpsModule paramJpsModule, @Nullable Element paramElement, @Nullable JpsSdkType<?> paramJpsSdkType)
/*  72:    */   {
/*  73: 77 */     if (paramElement == null) {
/*  74: 77 */       return;
/*  75:    */     }
/*  76: 79 */     for (Object localObject1 = JDOMUtil.getChildren(paramElement, "content").iterator(); ((Iterator)localObject1).hasNext();)
/*  77:    */     {
/*  78: 79 */       localObject2 = (Element)((Iterator)localObject1).next();
/*  79: 80 */       localObject3 = ((Element)localObject2).getAttributeValue("url");
/*  80: 81 */       paramJpsModule.getContentRootsList().addUrl((String)localObject3);
/*  81: 82 */       for (localIterator = JDOMUtil.getChildren((Element)localObject2, "sourceFolder").iterator(); localIterator.hasNext();)
/*  82:    */       {
/*  83: 82 */         localObject4 = (Element)localIterator.next();
/*  84: 83 */         paramJpsModule.addSourceRoot(loadSourceRoot((Element)localObject4));
/*  85:    */       }
/*  86: 85 */       for (localIterator = JDOMUtil.getChildren((Element)localObject2, "excludeFolder").iterator(); localIterator.hasNext();)
/*  87:    */       {
/*  88: 85 */         localObject4 = (Element)localIterator.next();
/*  89: 86 */         paramJpsModule.getExcludeRootsList().addUrl(((Element)localObject4).getAttributeValue("url"));
/*  90:    */       }
/*  91:    */     }
/*  92:    */     Object localObject4;
/*  93: 90 */     localObject1 = paramJpsModule.getDependenciesList();
/*  94: 91 */     ((JpsDependenciesList)localObject1).clear();
/*  95: 92 */     Object localObject2 = JpsElementFactory.getInstance();
/*  96: 93 */     Object localObject3 = new UniqueNameGenerator();
/*  97: 94 */     for (Iterator localIterator = JDOMUtil.getChildren(paramElement, "orderEntry").iterator(); localIterator.hasNext();)
/*  98:    */     {
/*  99: 94 */       localObject4 = (Element)localIterator.next();
/* 100: 95 */       String str = ((Element)localObject4).getAttributeValue("type");
/* 101: 96 */       if ("sourceFolder".equals(str))
/* 102:    */       {
/* 103: 97 */         ((JpsDependenciesList)localObject1).addModuleSourceDependency();
/* 104:    */       }
/* 105:    */       else
/* 106:    */       {
/* 107:    */         Object localObject5;
/* 108:    */         Object localObject6;
/* 109:    */         Object localObject7;
/* 110: 99 */         if ("jdk".equals(str))
/* 111:    */         {
/* 112:100 */           localObject5 = ((Element)localObject4).getAttributeValue("jdkName");
/* 113:101 */           localObject6 = ((Element)localObject4).getAttributeValue("jdkType");
/* 114:102 */           localObject7 = JpsSdkTableSerializer.getSdkType((String)localObject6);
/* 115:103 */           ((JpsDependenciesList)localObject1).addSdkDependency((JpsSdkType)localObject7);
/* 116:104 */           JpsSdkTableSerializer.setSdkReference(paramJpsModule.getSdkReferencesTable(), (String)localObject5, (JpsSdkType)localObject7);
/* 117:105 */           if ((localObject7 instanceof JpsJavaSdkTypeWrapper)) {
/* 118:106 */             ((JpsDependenciesList)localObject1).addSdkDependency(JpsJavaSdkType.INSTANCE);
/* 119:    */           }
/* 120:    */         }
/* 121:109 */         else if ("inheritedJdk".equals(str))
/* 122:    */         {
/* 123:110 */           localObject5 = paramJpsSdkType != null ? paramJpsSdkType : JpsJavaSdkType.INSTANCE;
/* 124:111 */           ((JpsDependenciesList)localObject1).addSdkDependency((JpsSdkType)localObject5);
/* 125:112 */           if ((localObject5 instanceof JpsJavaSdkTypeWrapper)) {
/* 126:113 */             ((JpsDependenciesList)localObject1).addSdkDependency(JpsJavaSdkType.INSTANCE);
/* 127:    */           }
/* 128:    */         }
/* 129:116 */         else if ("library".equals(str))
/* 130:    */         {
/* 131:117 */           localObject5 = ((Element)localObject4).getAttributeValue("name");
/* 132:118 */           localObject6 = ((Element)localObject4).getAttributeValue("level");
/* 133:119 */           localObject7 = ((JpsDependenciesList)localObject1).addLibraryDependency(((JpsElementFactory)localObject2).createLibraryReference((String)localObject5, JpsLibraryTableSerializer.createLibraryTableReference((String)localObject6)));
/* 134:    */           
/* 135:    */ 
/* 136:122 */           a((JpsDependencyElement)localObject7, (Element)localObject4);
/* 137:    */         }
/* 138:124 */         else if ("module-library".equals(str))
/* 139:    */         {
/* 140:125 */           localObject5 = ((Element)localObject4).getChild("library");
/* 141:126 */           localObject6 = ((Element)localObject5).getAttributeValue("name");
/* 142:127 */           if (localObject6 == null) {
/* 143:128 */             localObject6 = "#";
/* 144:    */           }
/* 145:130 */           localObject7 = ((UniqueNameGenerator)localObject3).generateUniqueName((String)localObject6);
/* 146:131 */           JpsLibrary localJpsLibrary = JpsLibraryTableSerializer.loadLibrary((Element)localObject5, (String)localObject7);
/* 147:132 */           paramJpsModule.addModuleLibrary(localJpsLibrary);
/* 148:    */           
/* 149:134 */           JpsLibraryDependency localJpsLibraryDependency = ((JpsDependenciesList)localObject1).addLibraryDependency(localJpsLibrary);
/* 150:135 */           a(localJpsLibraryDependency, (Element)localObject4);
/* 151:    */         }
/* 152:137 */         else if ("module".equals(str))
/* 153:    */         {
/* 154:138 */           localObject5 = ((Element)localObject4).getAttributeValue("module-name");
/* 155:139 */           localObject6 = ((JpsDependenciesList)localObject1).addModuleDependency(((JpsElementFactory)localObject2).createModuleReference((String)localObject5));
/* 156:140 */           a((JpsDependencyElement)localObject6, (Element)localObject4);
/* 157:    */         }
/* 158:    */       }
/* 159:    */     }
/* 160:144 */     for (localIterator = JpsModelSerializerExtension.getExtensions().iterator(); localIterator.hasNext();)
/* 161:    */     {
/* 162:144 */       localObject4 = (JpsModelSerializerExtension)localIterator.next();
/* 163:145 */       ((JpsModelSerializerExtension)localObject4).loadRootModel(paramJpsModule, paramElement);
/* 164:    */     }
/* 165:    */   }
/* 166:    */   
/* 167:    */   @NotNull
/* 168:    */   public static JpsModuleSourceRoot loadSourceRoot(Element paramElement)
/* 169:    */   {
/* 170:151 */     String str = paramElement.getAttributeValue("url");
/* 171:152 */     JpsModuleSourceRootPropertiesSerializer localJpsModuleSourceRootPropertiesSerializer = a(paramElement); JpsModuleSourceRoot 
/* 172:153 */       tmp18_15 = a(str, localJpsModuleSourceRootPropertiesSerializer, paramElement);
/* 173:153 */     if (tmp18_15 == null) {
/* 174:153 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/serialization/module/JpsModuleRootModelSerializer", "loadSourceRoot" }));
/* 175:    */     }
/* 176:153 */     return tmp18_15;
/* 177:    */   }
/* 178:    */   
/* 179:    */   @NotNull
/* 180:    */   private static <P extends JpsElement> JpsModuleSourceRoot a(@NotNull String paramString, @NotNull JpsModuleSourceRootPropertiesSerializer<P> paramJpsModuleSourceRootPropertiesSerializer, @NotNull Element paramElement)
/* 181:    */   {
/* 182:160 */     if (paramString == null) {
/* 183:160 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/serialization/module/JpsModuleRootModelSerializer", "createSourceRoot" }));
/* 184:    */     }
/* 185:160 */     if (paramJpsModuleSourceRootPropertiesSerializer == null) {
/* 186:160 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/jetbrains/jps/model/serialization/module/JpsModuleRootModelSerializer", "createSourceRoot" }));
/* 187:    */     }
/* 188:160 */     if (paramElement == null) {
/* 189:160 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "2", "org/jetbrains/jps/model/serialization/module/JpsModuleRootModelSerializer", "createSourceRoot" }));
/* 190:    */     }
/* 191:160 */     JpsModuleSourceRoot tmp163_160 = JpsElementFactory.getInstance().createModuleSourceRoot(paramString, (JpsModuleSourceRootType)paramJpsModuleSourceRootPropertiesSerializer.getType(), paramJpsModuleSourceRootPropertiesSerializer.loadProperties(paramElement));
/* 192:160 */     if (tmp163_160 == null) {
/* 193:160 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/serialization/module/JpsModuleRootModelSerializer", "createSourceRoot" }));
/* 194:    */     }
/* 195:160 */     return tmp163_160;
/* 196:    */   }
/* 197:    */   
/* 198:    */   @NotNull
/* 199:    */   private static JpsModuleSourceRootPropertiesSerializer<?> a(@NotNull Element paramElement)
/* 200:    */   {
/* 201:165 */     if (paramElement == null) {
/* 202:165 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/serialization/module/JpsModuleRootModelSerializer", "getSourceRootPropertiesSerializer" }));
/* 203:    */     }
/* 204:165 */     String str = paramElement.getAttributeValue("type");
/* 205:166 */     if (str == null) {
/* 206:167 */       str = Boolean.parseBoolean(paramElement.getAttributeValue("isTestSource")) ? "java-test" : "java-source";
/* 207:    */     }
/* 208:169 */     for (JpsModelSerializerExtension localJpsModelSerializerExtension : JpsModelSerializerExtension.getExtensions()) {
/* 209:170 */       for (JpsModuleSourceRootPropertiesSerializer localJpsModuleSourceRootPropertiesSerializer : localJpsModelSerializerExtension.getModuleSourceRootPropertiesSerializers()) {
/* 210:171 */         if (localJpsModuleSourceRootPropertiesSerializer.getTypeId().equals(str))
/* 211:    */         {
/* 212:172 */           JpsModuleSourceRootPropertiesSerializer tmp154_152 = localJpsModuleSourceRootPropertiesSerializer;
/* 213:172 */           if (tmp154_152 == null) {
/* 214:172 */             throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/serialization/module/JpsModuleRootModelSerializer", "getSourceRootPropertiesSerializer" }));
/* 215:    */           }
/* 216:172 */           return tmp154_152;
/* 217:    */         }
/* 218:    */       }
/* 219:    */     }
/* 220:176 */     a.warn("Unknown module source root type " + str); JpsJavaModelSerializerExtension.JavaSourceRootPropertiesSerializer 
/* 221:177 */       tmp230_227 = JpsJavaModelSerializerExtension.JAVA_SOURCE_ROOT_PROPERTIES_SERIALIZER;
/* 222:177 */     if (tmp230_227 == null) {
/* 223:177 */       throw new IllegalStateException(String.format("@NotNull method %s.%s must not return null", new Object[] { "org/jetbrains/jps/model/serialization/module/JpsModuleRootModelSerializer", "getSourceRootPropertiesSerializer" }));
/* 224:    */     }
/* 225:177 */     return tmp230_227;
/* 226:    */   }
/* 227:    */   
/* 228:    */   public static void saveRootModel(JpsModule paramJpsModule, Element paramElement)
/* 229:    */   {
/* 230:181 */     List localList1 = paramJpsModule.getSourceRoots();
/* 231:182 */     List localList2 = a(paramJpsModule.getExcludeRootsList().getUrls());
/* 232:183 */     for (Iterator localIterator = a(paramJpsModule.getContentRootsList().getUrls()).iterator(); localIterator.hasNext();)
/* 233:    */     {
/* 234:183 */       localObject1 = (String)localIterator.next();
/* 235:184 */       localObject2 = new Element("content");
/* 236:185 */       ((Element)localObject2).setAttribute("url", (String)localObject1);
/* 237:186 */       paramElement.addContent((Element)localObject2);
/* 238:187 */       for (localObject3 = localList1.iterator(); ((Iterator)localObject3).hasNext();)
/* 239:    */       {
/* 240:187 */         localObject4 = (JpsModuleSourceRoot)((Iterator)localObject3).next();
/* 241:188 */         if (FileUtil.startsWith(((JpsModuleSourceRoot)localObject4).getUrl(), (String)localObject1)) {
/* 242:189 */           saveSourceRoot((Element)localObject2, ((JpsModuleSourceRoot)localObject4).asTyped().getUrl(), ((JpsModuleSourceRoot)localObject4).asTyped());
/* 243:    */         }
/* 244:    */       }
/* 245:192 */       for (localObject3 = localList2.iterator(); ((Iterator)localObject3).hasNext();)
/* 246:    */       {
/* 247:192 */         localObject4 = (String)((Iterator)localObject3).next();
/* 248:193 */         if (FileUtil.startsWith((String)localObject4, (String)localObject1))
/* 249:    */         {
/* 250:194 */           localElement = new Element("excludeFolder").setAttribute("url", (String)localObject4);
/* 251:195 */           ((Element)localObject2).addContent(localElement);
/* 252:    */         }
/* 253:    */       }
/* 254:    */     }
/* 255:    */     Object localObject1;
/* 256:    */     Object localObject2;
/* 257:    */     Object localObject3;
/* 258:    */     Object localObject4;
/* 259:    */     Element localElement;
/* 260:200 */     for (localIterator = paramJpsModule.getDependenciesList().getDependencies().iterator(); localIterator.hasNext();)
/* 261:    */     {
/* 262:200 */       localObject1 = (JpsDependencyElement)localIterator.next();
/* 263:201 */       if ((localObject1 instanceof JpsModuleSourceDependency))
/* 264:    */       {
/* 265:202 */         paramElement.addContent(b("sourceFolder").setAttribute("forTests", "false"));
/* 266:    */       }
/* 267:204 */       else if ((localObject1 instanceof JpsSdkDependency))
/* 268:    */       {
/* 269:205 */         localObject2 = ((JpsSdkDependency)localObject1).getSdkType();
/* 270:206 */         localObject3 = paramJpsModule.getSdkReferencesTable();
/* 271:207 */         localObject4 = ((JpsSdkReferencesTable)localObject3).getSdkReference((JpsSdkType)localObject2);
/* 272:208 */         if (localObject4 == null)
/* 273:    */         {
/* 274:209 */           paramElement.addContent(b("inheritedJdk"));
/* 275:    */         }
/* 276:    */         else
/* 277:    */         {
/* 278:212 */           localElement = b("jdk");
/* 279:213 */           localElement.setAttribute("jdkName", ((JpsSdkReference)localObject4).getSdkName());
/* 280:214 */           localElement.setAttribute("jdkType", JpsSdkTableSerializer.getLoader((JpsSdkType)localObject2).getTypeId());
/* 281:215 */           paramElement.addContent(localElement);
/* 282:    */         }
/* 283:    */       }
/* 284:218 */       else if ((localObject1 instanceof JpsLibraryDependency))
/* 285:    */       {
/* 286:219 */         localObject2 = ((JpsLibraryDependency)localObject1).getLibraryReference();
/* 287:220 */         localObject3 = ((JpsLibraryReference)localObject2).getParentReference();
/* 288:222 */         if ((localObject3 instanceof JpsModuleReference))
/* 289:    */         {
/* 290:223 */           localObject4 = b("module-library");
/* 291:224 */           b((JpsDependencyElement)localObject1, (Element)localObject4);
/* 292:225 */           localElement = new Element("library");
/* 293:226 */           JpsLibrary localJpsLibrary = (JpsLibrary)((JpsLibraryReference)localObject2).resolve();
/* 294:227 */           String str = localJpsLibrary.getName();
/* 295:228 */           JpsLibraryTableSerializer.saveLibrary(localJpsLibrary, localElement, a(str) ? null : str);
/* 296:229 */           ((Element)localObject4).addContent(localElement);
/* 297:    */         }
/* 298:    */         else
/* 299:    */         {
/* 300:232 */           localObject4 = b("library");
/* 301:233 */           b((JpsDependencyElement)localObject1, (Element)localObject4);
/* 302:234 */           ((Element)localObject4).setAttribute("name", ((JpsLibraryReference)localObject2).getLibraryName());
/* 303:235 */           ((Element)localObject4).setAttribute("level", JpsLibraryTableSerializer.getLevelId((JpsElementReference)localObject3));
/* 304:    */         }
/* 305:237 */         paramElement.addContent((Element)localObject4);
/* 306:    */       }
/* 307:239 */       else if ((localObject1 instanceof JpsModuleDependency))
/* 308:    */       {
/* 309:240 */         localObject2 = b("module");
/* 310:241 */         ((Element)localObject2).setAttribute("module-name", ((JpsModuleDependency)localObject1).getModuleReference().getModuleName());
/* 311:242 */         b((JpsDependencyElement)localObject1, (Element)localObject2);
/* 312:243 */         paramElement.addContent((Element)localObject2);
/* 313:    */       }
/* 314:    */     }
/* 315:247 */     for (localIterator = JpsModelSerializerExtension.getExtensions().iterator(); localIterator.hasNext();)
/* 316:    */     {
/* 317:247 */       localObject1 = (JpsModelSerializerExtension)localIterator.next();
/* 318:248 */       ((JpsModelSerializerExtension)localObject1).saveRootModel(paramJpsModule, paramElement);
/* 319:    */     }
/* 320:    */   }
/* 321:    */   
/* 322:    */   public static <P extends JpsElement> void saveSourceRoot(@NotNull Element paramElement, @NotNull String paramString, @NotNull JpsTypedModuleSourceRoot<P> paramJpsTypedModuleSourceRoot)
/* 323:    */   {
/* 324:255 */     if (paramElement == null) {
/* 325:255 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "0", "org/jetbrains/jps/model/serialization/module/JpsModuleRootModelSerializer", "saveSourceRoot" }));
/* 326:    */     }
/* 327:255 */     if (paramString == null) {
/* 328:255 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "1", "org/jetbrains/jps/model/serialization/module/JpsModuleRootModelSerializer", "saveSourceRoot" }));
/* 329:    */     }
/* 330:255 */     if (paramJpsTypedModuleSourceRoot == null) {
/* 331:255 */       throw new IllegalArgumentException(String.format("Argument %s for @NotNull parameter of %s.%s must not be null", new Object[] { "2", "org/jetbrains/jps/model/serialization/module/JpsModuleRootModelSerializer", "saveSourceRoot" }));
/* 332:    */     }
/* 333:255 */     Element localElement = new Element("sourceFolder");
/* 334:256 */     localElement.setAttribute("url", paramString);
/* 335:257 */     JpsModuleSourceRootPropertiesSerializer localJpsModuleSourceRootPropertiesSerializer = a(paramJpsTypedModuleSourceRoot.getRootType());
/* 336:258 */     if (localJpsModuleSourceRootPropertiesSerializer != null)
/* 337:    */     {
/* 338:259 */       String str = localJpsModuleSourceRootPropertiesSerializer.getTypeId();
/* 339:260 */       if ((!str.equals("java-source")) && (!str.equals("java-test"))) {
/* 340:261 */         localElement.setAttribute("type", str);
/* 341:    */       }
/* 342:263 */       localJpsModuleSourceRootPropertiesSerializer.saveProperties(paramJpsTypedModuleSourceRoot.getProperties(), localElement);
/* 343:    */     }
/* 344:265 */     paramElement.addContent(localElement);
/* 345:    */   }
/* 346:    */   
/* 347:    */   @Nullable
/* 348:    */   private static <P extends JpsElement> JpsModuleSourceRootPropertiesSerializer<P> a(JpsModuleSourceRootType<P> paramJpsModuleSourceRootType)
/* 349:    */   {
/* 350:270 */     for (JpsModelSerializerExtension localJpsModelSerializerExtension : ) {
/* 351:271 */       for (JpsModuleSourceRootPropertiesSerializer localJpsModuleSourceRootPropertiesSerializer : localJpsModelSerializerExtension.getModuleSourceRootPropertiesSerializers()) {
/* 352:272 */         if (((JpsModuleSourceRootType)localJpsModuleSourceRootPropertiesSerializer.getType()).equals(paramJpsModuleSourceRootType)) {
/* 353:273 */           return localJpsModuleSourceRootPropertiesSerializer;
/* 354:    */         }
/* 355:    */       }
/* 356:    */     }
/* 357:277 */     return null;
/* 358:    */   }
/* 359:    */   
/* 360:    */   private static boolean a(String paramString)
/* 361:    */   {
/* 362:281 */     return paramString.startsWith("#");
/* 363:    */   }
/* 364:    */   
/* 365:    */   private static Element b(String paramString)
/* 366:    */   {
/* 367:285 */     return new Element("orderEntry").setAttribute("type", paramString);
/* 368:    */   }
/* 369:    */   
/* 370:    */   private static List<String> a(List<String> paramList)
/* 371:    */   {
/* 372:289 */     ArrayList localArrayList = new ArrayList(paramList);
/* 373:290 */     Collections.sort(localArrayList);
/* 374:291 */     return localArrayList;
/* 375:    */   }
/* 376:    */   
/* 377:    */   private static void a(JpsDependencyElement paramJpsDependencyElement, Element paramElement)
/* 378:    */   {
/* 379:295 */     for (JpsModelSerializerExtension localJpsModelSerializerExtension : ) {
/* 380:296 */       localJpsModelSerializerExtension.loadModuleDependencyProperties(paramJpsDependencyElement, paramElement);
/* 381:    */     }
/* 382:    */   }
/* 383:    */   
/* 384:    */   private static void b(JpsDependencyElement paramJpsDependencyElement, Element paramElement)
/* 385:    */   {
/* 386:301 */     for (JpsModelSerializerExtension localJpsModelSerializerExtension : ) {
/* 387:302 */       localJpsModelSerializerExtension.saveModuleDependencyProperties(paramJpsDependencyElement, paramElement);
/* 388:    */     }
/* 389:    */   }
/* 390:    */ }



/* Location:           E:\idea\

 * Qualified Name:     org.jetbrains.jps.model.serialization.module.JpsModuleRootModelSerializer

 * JD-Core Version:    0.7.0.1

 */